#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
string next(string a){
	int num = 1;
	string back;
	char before = a[0];
	for(int i = 1;i < a.length();i++){
		if(a[i]==before) num++;
		else{
			back += (before+to_string(num));
			before = a[i];
			num = 1;
		}
	}
	back += (before+to_string(num));
	return back;
}
int main(){
	int k,n;
	string ans;
	cin >> k >> n;
	ans = to_string(k);
	for(int i = 1;i < n;i++){
		ans = next(ans);
	}
	cout << ans;
	return 0;
}

